package odgs.transaction;

import odgs.ExplorerNode;
import odgs.Transaction;

public class CopyTransaction extends Transaction
{
	private ExplorerNode source;
	private String	path;

	public CopyTransaction(long id)
	{
		super(id);
	}

	@Override
	public String getName()
	{
		return "CopyTransaction";
	}

	public void setSource(ExplorerNode con)
	{
		source = con;
	}

	public void setDestPath(String path)
	{
		this.path = path;
	}

	public ExplorerNode getSource()
	{
		return source;
	}

	public String getDestPath()
	{
		return path;
	}

	@Override
	public boolean isFileTrans()
	{
		return false;
	}
	
	@Override
	public String toString()
	{
		if(source.canChildren())
			return "Copy : " + source.getName() + " to " + path;
		else
		{
			return "Copy : " + source.getName()+"." + source.getType() + " to " + path;
		}
	}
}